﻿using System;
using System.Reflection;
using System.Windows.Forms;
using System.Drawing;

namespace Parabola
{
    public partial class InfoWindow : Form
    {
        public InfoWindow()
        {
            InitializeComponent();
            InitializeText();
        }

        private void BlueInfoWindow_Load(object sender, EventArgs e)
        {
            lblInfo.Text = "This function plotter is published as free software \n\runder Simplified BSD License for you to use and modify.";
        }

        private void InitializeText()
        {
            string name =
                ((AssemblyProductAttribute)Assembly.GetExecutingAssembly().GetCustomAttribute(typeof(AssemblyProductAttribute))).Product;
            this.Text = String.Format("About {0}", name);
            lblTitle.Text = name;
            string title =
                ((AssemblyTitleAttribute)Assembly.GetExecutingAssembly().GetCustomAttribute(typeof(AssemblyTitleAttribute))).Title;
            lblName.Text = String.Format("{0}", title);
            string company =
                ((AssemblyCompanyAttribute)Assembly.GetExecutingAssembly().GetCustomAttribute(typeof(AssemblyCompanyAttribute))).Company;
            lblCompany.Text = String.Format("Company: {0}", company);
            string version =
                ((AssemblyFileVersionAttribute)Assembly.GetExecutingAssembly().GetCustomAttribute(typeof(AssemblyFileVersionAttribute))).Version;
            lblVersion.Text = String.Format("Version: {0}", version);
            string copyright =
                ((AssemblyCopyrightAttribute)Assembly.GetExecutingAssembly().GetCustomAttribute(typeof(AssemblyCopyrightAttribute))).Copyright;
            lblCopyright.Text = copyright;
        }
    }
}
